#pragma once
/***********************************************************************************************
COPYRIGHT 2011 Mafahir Fairoze

This file is part of Neural++.
(Project Website : http://mafahir.wordpress.com/projects/neuralplusplus)

Neural++ is a free software. You can redistribute it and/or modify it under the terms of
the GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.

Neural++ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License <http://www.gnu.org/licenses/> for more details.

***********************************************************************************************/

#include "ActivationLayer.h"
#include "../Connector.h"

namespace NeuralPlusPlus
	{
	namespace Core
		{
		namespace Backpropagation        
			{
			/// <summary>
			/// A Backpropagation Connector is an <see cref="IConnector"/> which consists of a collection of
			/// backpropagation synapses connecting two activation layers.
			/// </summary>
			class BackpropagationConnector
				: public Connector
				{
				public: double Momentum;

						/// <summary>
						/// Creates a new Backpropagation connector between the given layers using the specified
						/// connection mode.
						/// </summary>
				public: BackpropagationConnector(ActivationLayer *sourceLayer, ActivationLayer *targetLayer, ConnectionModeType connectionMode = ConnectionModeType::Complete);

						/// <summary>
						/// Initializes all synapses in the connector and makes them ready to undergo training
						/// freshly. (Adjusts the weights of synapses using the initializer)
						/// </summary>
				public: void Initialize() override;

						/// <summary>
						/// Private helper to construct synapses between layers
						/// </summary>
				protected: void ConstructSynapses() override;
				};
			}
		}
	}